<%@page contentType="text/html; charset=UTF-8" language="java" pageEncoding="UTF-8"%>

<% 
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getLocalName()+":"+request.getLocalPort()+path+"/";
%>
<script type="text/javascript">
	
</script>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<table width="100%" border="0" cellpadding="0" cellspacing="0" >
	<tr>
		<td nowrap class="title1">明细信息</td>
	</tr>
</table>
<table width="100%" border="0" align="center" cellspacing="1"
	class="c">
	<tr>
		<td class="title1">采购单编号</td>
		<td class="title1">供应商名称</td>
		<td class="title1">创建日期</td>
		<td class="title1">创建用户</td>
		<td class="title1">附加费用</td>
		<td class="title1">采购单总金额</td>
		<td class="title1">未付款金额</td>
		<td class="title1">付款方式</td>
		<td class="title1">最低预付款金额</td>
		<td class="title1">处理状态</td>
	</tr>
	<c:forEach items="${page.dataList }" var="po">
		<tr ondblclick="showDetail(${po.poId},this)">
			<td align="center">${po.poId }</td>
			<td align="center">${po.venderName}</td>
			<td align="center">${po.createTime }</td>
			<td align="center">${po.account}</td>
			<td align="center">${po.tipFee}</td>
			<td align="center">${po.poTotal}</td>
			<td align="center">
				<c:if test="${po.payType==1}">
					<c:if test="${po.status <2 }">${po.poTotal}</c:if>
					<c:if test="${po.status >=2 }">0</c:if>
				</c:if>
				<c:if test="${po.payType==2}">
					<c:if test="${po.status <=1 }">${po.poTotal}</c:if>
					<c:if test="${po.status >=2 }">0</c:if>
				</c:if>
				<c:if test="${po.payType==3}">
					<c:if test="${po.status == 1 }">${po.poTotal}</c:if>
					<c:if test="${po.status == 5 || po.status ==2 }">0</c:if>
					<c:if test="${po.status == 3 || po.status ==4 }">${po.poTotal-po.prePayFee}</c:if>
					
				</c:if>
			</td>
			<td align="center">
				<c:if test="${po.payType==1}">货到付款</c:if>
				<c:if test="${po.payType==2}">款到发货</c:if>
				<c:if test="${po.payType==3}">预付款到发货</c:if>
			</td>
			<td align="center">${po.prePayFee}</td>
			<td align="center">
				<c:if test="${po.status ==1 }">新增</c:if>
				<c:if test="${po.status ==2 }">已付款</c:if>
				<c:if test="${po.status ==3 }">已预付</c:if>
				<c:if test="${po.status ==4 }">已入库</c:if>
				<c:if test="${po.status ==5 }">已了结</c:if>
			</td>
		</tr>
	</c:forEach>
</table><br/>
<center>

	<c:if test="${page.currentPage == 1}">
		<input type="button" value="首页" disabled="disabled"/>
		
		<input type="button" value="上一页" disabled="disabled"/>
	</c:if>
	<c:if test="${page.currentPage != 1}">
		<input type="button" value="首页" onclick="goPage(1)"/>
		<input type="button" value="上一页" onclick="goPage(${page.currentPage-1})"/>
	</c:if>
	<c:if test="${page.currentPage == page.pageCount}">
		<input type="button" value="下一页" disabled="disabled"/>
		<input type="button" value="末页" disabled="disabled"/>
	</c:if>
	<c:if test="${page.currentPage != page.pageCount}">
		<input type="button" value="下一页" onclick="goPage(${page.currentPage+1})"/>
		<input type="button" value="末页" onclick="goPage(${page.pageCount})"/>
	</c:if>
	<input type="hidden" value="${page.currentPage }" id="cpageNo">
	<!-- <select id="selectPage" onchange="selectPage()">
		<c:forEach begin="1" end="${page.pageCount }" var="mypage">
			<option value="${mypage }" id="option">第${mypage }页</option>
		</c:forEach>
	</select> -->
	
	当前第<span id="currentPage">${page.currentPage}</span>页 共${page.pageCount}页  每页${page.pageSize }条记录
	</center>
